export const  usePosts = async () => {
  return await useAsyncData('posts', () =>
    $fetch('http://localhost:8080/system/studentInfo/list')
  )
}
export const  getCode = async (phoneNumber) => {
  return await useAsyncData('get', () =>
    $fetch('http://localhost:8080/AliyunCode/getcode/'+phoneNumber)
  )
}

export const register = async (data) => {
  return await $fetch('http://localhost:8080/registerForNew', {
    method: 'post',
    body:data,
    headers: {
      'Content-Type': 'application/json'  // 明确指定内容类型
    }
  })
}
export const login = async (data) => {
  return await $fetch('http://localhost:8080/loginForNew', {
    method: 'post',
    body:data,
    headers: {
      'Content-Type': 'application/json'  // 明确指定内容类型
    }
  })
}